package com.xsr.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xsr.mapper.GoodsMapper;
import com.xsr.pojo.Goods;
import com.xsr.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 邢式瑞
 * @version 1.0
 * @project xiaomi
 * @date 2022/9/13 21:49
 */
@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;
    @Override
    public PageInfo<Goods> findById(Integer typeId, Integer pn,Integer ps) {
        PageHelper.startPage(pn,ps);
        List<Goods> goods = goodsMapper.selectById(typeId);
        for (Goods good : goods) {
            System.out.println(good);
        }
        return new PageInfo<Goods>(goods);
    }
}
